package Job01;

public class Phone_Book {
    private String name;
    private char sex;
    private int age;
    private String phone;
    private String qQ;
    private String address;

    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public char getSex() {
        return sex;
    }
    public void setSex(char sex) {
        if (sex == '男' || sex == '女'){
            this.sex = sex;
        }else {
            System.out.println("性别不能为中性,人妖等等!!!");
        }

    }
    public int getAge() {
        return age;
    }
    public void setAge(int age) {
        if (age >= 0 && age <= 150){
            this.age = age;
        }else {
            System.out.println("年龄不能为负的或者超出范围的!!!");
        }

    }
    public String getPhone() {
        return phone;
    }
    public void setPhone(String phone) {
        this.phone = phone;
    }
    public String getqQ() {
        return qQ;
    }
    public void setqQ(String qQ) {
        this.qQ = qQ;
    }
    public String getAddress() {
        return address;
    }
    public void setAddress(String address) {
        this.address = address;
    }

    public Phone_Book(String name, char sex, int age, String phone, String qQ, String address) {
        this.name = name;
        this.sex = sex;
        this.age = age;
        this.phone = phone;
        this.qQ = qQ;
        this.address = address;
    }

    public Phone_Book() {
    }
}
